import React, { Component } from 'react'

export default class News2 extends Component {
    state={
        news2:[
            {'title':'1','content':'text1'},
            {'title':'2','content':'text2'},
            {'title':'3','content':'text3'},
        ],
        title:'',
        content:''
    }
    UNSAFE_componentWillMount(){
        var obj = this.state.news2[this.props.match.params.title]
        this.setState({
            'title':obj.title,
            'content':obj.content
        })
        
    }
    render() {
        return (
            <>
                <h6>{this.state.title}</h6>
                <h6>{this.state.content}</h6>
            </>
        )
    }
}
